<?php

$pagedList = $this->pagedList;

?>
<p class="paginator"><?php

if ($pagedList->pageIndex > 1)
	echo '<a href="?pageIndex=0"><span>&laquo;</span></a> ';

if ($pagedList->pageIndex > 0)
	echo '<a href="?pageIndex=', ($pagedList->pageIndex - 1), '"><span>&lt;</span></a> ';

$startIndex = $pagedList->pageIndex - 3 >= 0 ? $pagedList->pageIndex - 3 : 0;
$end = $pagedList->pageIndex;
for ($i = $startIndex; $i < $end; ++$i)
	echo '<a href="?pageIndex=', $i, '"><span>', ($i + 1), '</span></a> ';

echo '<span>', $pagedList->pageIndex + 1, '</span> ';

$startIndex = $pagedList->pageIndex + 1;
$end = $pagedList->pageIndex + 4 < $pagedList->pagesCount ? $pagedList->pageIndex + 4 : $pagedList->pagesCount;
for ($i = $startIndex; $i < $end; ++$i)
	echo '<a href="?pageIndex=', $i, '"><span>', ($i + 1), '</span></a> ';

if (($pagedList->pageIndex + 1) < $pagedList->pagesCount)
	echo '<a href="?pageIndex=', $pagedList->pagesCount - 1, '"><span>&raquo;</span></a> ';

?></p>